home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Resources / Developers / XAMPP 1.5.4 / Windows installer / xampp-win32-1.5.4-installer.exe / xampp / contrib / mysql.php < prev    next >
Text File  |  2006-04-09  |  613b  |  32 lines

  1. <html>
  2. <head>
  3. <title>PHP und MySQL</title>
  4. </head>
  5. <body>
  6. <h1>PHP und MySQL</h1>
  7. <table border="1">
  8. <tr>
  9.     <th>Vorname</th>
  10.     <th>Nachname</th>
  11.     <th>Telefonnummer</th>
  12. </tr>
  13. <?php
  14.     mysql_connect("localhost", "oswald", "geheim");
  15.     mysql_select_db("phonebook");
  16.  
  17.     $query = "SELECT * FROM users";
  18.     $result = mysql_query($query);
  19.     while ($row = mysql_fetch_array  ($result))
  20.     {
  21.         echo "<tr>";
  22.         echo "<td>".$row['firstname']."</td>";
  23.         echo "<td>".$row['lastname']."</td>";
  24.         echo "<td>".$row['phone']."</td>";
  25.         echo "</tr>";
  26.     }
  27.  
  28. ?>
  29. </table>
  30. </body>
  31. </html>
  32.